﻿@model RedSand.Site.Models.CategoryInfo
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<div class="dialog" title="Create" style="width: 646px;">
    @using (Ajax.BeginForm(AdminAjaxOptions.CreateNew))
    {
        @Html.HiddenFor(model => model.ParentID)
        <div class="dialog-content">
            <div style="float:left;width:338px;">
                <div class="form-cell none-float">
                    @Html.LabelFor(model => model.Name)
                    @Html.EditorFor(model => model.Name)
                </div>
                <div class="form-cell none-float">
                    @Html.LabelFor(model => model.Alias)
                    @Html.EditorFor(model => model.Alias)
                </div>
                <div class="form-cell">
                    @Html.LabelFor(model => model.ForCustomPc)
                    @Html.DropDownListFor(model => model.ForCustomPc, new[] { new SelectListItem { Text = "No", Value = "false" }, new SelectListItem { Text = "Yes", Value = "true" } })
                </div>
                <div class="form-cell">
                    @Html.LabelFor(model => model.IsPopular)
                    @Html.DropDownListFor(model => model.IsPopular, new[] { new SelectListItem { Text = "No", Value = "false" }, new SelectListItem { Text = "Yes", Value = "true" } })
                </div>
                <div class="form-cell">
                    @Html.LabelFor(model => model.Order)
                    @Html.DropDownListFor(model => model.Order, DropDownListHelper.GetOrderList(Model.Order.Value))
                </div>
                <div class="form-cell">
                    @Html.LabelFor(model => model.Status)
                    @Html.DropDownListFor(model => model.Status, DropDownListHelper.GetStatusList(false))
                </div>
            </div>
            <div style="float:right;width:250px">
                <div class="form-cell none-float">
                    @Html.LabelFor(model => model.Image)
                    <input type="text" id="choose-avatar" class="choose-file" name="NewImage"/>
                </div>
                <div>
                    <img id="upload-image-preview" alt="" src="" style="width:100%" />
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="dialog-footer">
            <input type="submit" value="Save"/>
            <input type="button" value="Cancel" onclick="closeDialog('.dialog')" />
        </div>
    }
</div>
